/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
<#if package?? && package != "">
package ${package};
</#if> 

import java.io.IOException;
import static chanlib.Chan_IO.*;

/**
 * @author ${user}
 */
public class ${name}{
    /*
      All neccesary to be defined
      including:
      variable, inner class
    */
    // static int A;
    // static void B();
    // static class C

    /*
       One calculation fits all of the cases.
    */
    static void preReckon(){
        return;
    }



    /*
      calculate the answer
    */
    private static void reckon(int line) {
        int C=sc.nextInt();
        int I=sc.nextInt();
        int P[]=new int[I];
        for(int i=0;i<I;i++){
            P[i]=sc.nextInt();
        }
        //Arrays.sort(P);
        out.print(String.format("Case #%d: ",line));


        //anl.println(String.format("N=%d K=%d\n%s", N, K, ans));
        //println(output);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        /*
           Pre-computing for all cases
        */

        // Just in case!
        //preReckon();
        //while((char)read()!='P');

        /*
          Input-output
        */
        boolean test=false;
        boolean small=false;
        String prob="A";
        String filename;
        if(test) filename="test";
        else{
            if(small) filename=prob+"-small-practice";
            else filename=prob+"-large-practice";
        }
        try {
            /*
               Init IO,plus determination of input line number
             */
            initFileIO(filename);
            int lineNums=sc.nextInt();
            for (int i = 1; i <= lineNums; i++) {
                reckon(i);
                sys.println(i);
            }
        } finally {
            endIO();
        }
    }

    private static Scanner sc = null;
    private static PrintWriter out,anl = null;
    private static PrintStream sys=System.out;
    public final static int OUTFILE=0,ANALFILE=1;

    public static void  initFileIO(String filename) throws IOException{
        sc = new Scanner(
                new BufferedReader(new FileReader(filename+".in")));
            //s.useLocale(Locale.US);
        out = new PrintWriter(
                new BufferedWriter(new FileWriter(filename+".out")));
        anl = new PrintWriter(
                new BufferedWriter(new FileWriter(filename+".anal")));

    }

    public static void endIO(){
        sc.close();
        out.close();
    }

}
